package cn.coisini.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.groups.Default;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author xiangshaw
 * Description: 标签
 */
@Tag(name = "标签")
@Getter
@Setter
public class TagVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @NotBlank(groups = {TagVo.Update.class}, message = "标签id不能为空")
    private String id;
    @Schema(description = "ID多选值")
    List<String> ids;

    @Schema(description = "标签名称")
    @NotBlank(message = "标签名称不能为空")
    private String tagName;

    @Schema(description = "标签颜色")
    private String color;

    @Schema(description = "创建者ID")
    private String createUser;

    @Schema(description = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING , pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING , pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime updateTime;

    //自定义新增校验项分组（默认Default分组）
    public interface Add extends Default {
    }
    //自定义更新校验项分组
    public interface Update extends Default {
    }
}
